/*     */ package com.umeng.analytics;
/*     */ 
/*     */ import android.content.Context;
/*     */ import android.graphics.Bitmap;
/*     */ import android.os.Message;
/*     */ import android.webkit.JsPromptResult;
/*     */ import android.webkit.JsResult;
/*     */ import android.webkit.WebChromeClient;
/*     */ import android.webkit.WebSettings;
/*     */ import android.webkit.WebView;
/*     */ import java.util.HashMap;
/*     */ import java.util.Iterator;
/*     */ import org.json.JSONObject;
/*     */ 
/*     */ public class MobclickAgentJSInterface
/*     */ {
/*     */   private Context a;
/*     */ 
/*     */   public MobclickAgentJSInterface(Context paramContext, WebView paramWebView)
/*     */   {
/*  24 */     this.a = paramContext;
/*  25 */     paramWebView.getSettings().setJavaScriptEnabled(true);
/*  26 */     paramWebView.setWebChromeClient(new a(null));
/*     */   }
/*     */ 
/*     */   public MobclickAgentJSInterface(Context paramContext, WebView paramWebView, WebChromeClient paramWebChromeClient)
/*     */   {
/*  31 */     this.a = paramContext;
/*  32 */     paramWebView.getSettings().setJavaScriptEnabled(true);
/*  33 */     paramWebView.setWebChromeClient(new a(paramWebChromeClient));
/*     */   }
/*     */ 
/*     */   final class a extends WebChromeClient
/*     */   {
/*  51 */     WebChromeClient a = null;
/*  52 */     private final String c = "ekv";
/*  53 */     private final String d = "event";
/*     */ 
/*     */     public a(WebChromeClient arg2)
/*     */     {
/*     */       Object localObject;
/*  55 */       if (localObject == null)
/*  56 */         this.a = new WebChromeClient();
/*     */       else
/*  58 */         this.a = localObject;
/*     */     }
/*     */ 
/*     */     public boolean onJsPrompt(WebView paramWebView, String paramString1, String paramString2, String paramString3, JsPromptResult paramJsPromptResult)
/*     */     {
/*  66 */       JSONObject localJSONObject = null;
/*     */ 
/*  68 */       if ("ekv".equals(paramString2)) {
/*     */         try {
/*  70 */           localJSONObject = new JSONObject(paramString3);
/*     */ 
/*  72 */           HashMap localHashMap = new HashMap();
/*     */ 
/*  74 */           String str2 = (String)localJSONObject.remove("id");
/*     */ 
/*  76 */           int i = localJSONObject.isNull("duration") ? 0 : ((Integer)localJSONObject.remove("duration")).intValue();
/*     */ 
/*  79 */           Iterator localIterator = localJSONObject.keys();
/*     */ 
/*  81 */           String str3 = null;
/*  82 */           while (localIterator.hasNext()) {
/*  83 */             localHashMap.put(str3 = (String)localIterator.next(), localJSONObject.getString(str3));
/*     */           }
/*     */ 
/*  86 */           MobclickAgent.a().a(MobclickAgentJSInterface.a(MobclickAgentJSInterface.this), str2, localHashMap, i);
/*     */         } catch (Exception localException1) {
/*  88 */           localException1.printStackTrace();
/*     */         }
/*     */       }
/*  91 */       else if ("event".equals(paramString2))
/*     */         try {
/*  93 */           localJSONObject = new JSONObject(paramString3);
/*  94 */           String str1 = localJSONObject.optString("label");
/*     */ 
/*  96 */           if ("".equals(str1)) {
/*  97 */             str1 = null;
/*     */           }
/*     */ 
/* 100 */           MobclickAgent.a().a(MobclickAgentJSInterface.a(MobclickAgentJSInterface.this), localJSONObject.getString("tag"), str1, localJSONObject.optInt("duration"), 1);
/*     */         } catch (Exception localException2) {
/*     */         }
/* 103 */       else return this.a.onJsPrompt(paramWebView, paramString1, paramString2, paramString3, paramJsPromptResult);
/*     */ 
/* 106 */       paramJsPromptResult.confirm();
/* 107 */       return true;
/*     */     }
/*     */ 
/*     */     public void onCloseWindow(WebView paramWebView)
/*     */     {
/* 113 */       this.a.onCloseWindow(paramWebView);
/*     */     }
/*     */ 
/*     */     public boolean onCreateWindow(WebView paramWebView, boolean paramBoolean1, boolean paramBoolean2, Message paramMessage)
/*     */     {
/* 121 */       return this.a.onCreateWindow(paramWebView, paramBoolean1, paramBoolean2, paramMessage);
/*     */     }
/*     */ 
/*     */     public boolean onJsAlert(WebView paramWebView, String paramString1, String paramString2, JsResult paramJsResult)
/*     */     {
/* 129 */       return this.a.onJsAlert(paramWebView, paramString1, paramString2, paramJsResult);
/*     */     }
/*     */ 
/*     */     public boolean onJsBeforeUnload(WebView paramWebView, String paramString1, String paramString2, JsResult paramJsResult)
/*     */     {
/* 137 */       return this.a.onJsBeforeUnload(paramWebView, paramString1, paramString2, paramJsResult);
/*     */     }
/*     */ 
/*     */     public boolean onJsConfirm(WebView paramWebView, String paramString1, String paramString2, JsResult paramJsResult)
/*     */     {
/* 145 */       return this.a.onJsConfirm(paramWebView, paramString1, paramString2, paramJsResult);
/*     */     }
/*     */ 
/*     */     public void onProgressChanged(WebView paramWebView, int paramInt)
/*     */     {
/* 150 */       this.a.onProgressChanged(paramWebView, paramInt);
/*     */     }
/*     */ 
/*     */     public void onReceivedIcon(WebView paramWebView, Bitmap paramBitmap)
/*     */     {
/* 157 */       this.a.onReceivedIcon(paramWebView, paramBitmap);
/*     */     }
/*     */ 
/*     */     public void onReceivedTitle(WebView paramWebView, String paramString)
/*     */     {
/* 164 */       this.a.onReceivedTitle(paramWebView, paramString);
/*     */     }
/*     */ 
/*     */     public void onRequestFocus(WebView paramWebView)
/*     */     {
/* 171 */       this.a.onRequestFocus(paramWebView);
/*     */     }
/*     */   }
/*     */ }

/* Location:           C:\Users\Administrator\Desktop\umeng_sdk.jar
 * Qualified Name:     com.umeng.analytics.MobclickAgentJSInterface
 * JD-Core Version:    0.6.2
 */